package com.dys.service.impl;

import com.dys.dao.ClassDao;
import com.dys.dao.impl.ClassDaoImpl;
import com.dys.entity.Clazz;
import com.dys.service.ClassService;

import java.util.List;

/**
 * @Author: 疾风
 * @ClassName: ClassServiceImpl
 * @Description: 班级具体业务逻辑
 * @CreateDate: 2024/09/26
 * @Version: v1.0.0
 */
public class ClassServiceImpl implements ClassService {
    private final ClassDao classDao = new ClassDaoImpl();

    @Override
    public int saveClass(Clazz c) {
        return classDao.insertOneClass(c);
    }

    @Override
    public List<Clazz> findAllClass() {
        return classDao.listClass();
    }

    @Override
    public List<Clazz> selectClasses(int startIndex, int size) {
        return classDao.selectAllClasses(startIndex, size);
    }

    @Override
    public int getCountClass() {
        return classDao.selectCountClass();
    }

    @Override
    public int deleteOneClass(int cid) {
        return classDao.deleteOneClass(cid);
    }

    @Override
    public Clazz findOneClass(int cid) {
        return classDao.selectOneClass(cid);
    }

    @Override
    public int updateClass(Clazz c) {
        return classDao.updateOneClass(c);
    }

    @Override
    public List findClassCount() {
        return classDao.selectClassCount();
    }
}
